<!DOCTYPE html>
<html lang="en">
<head>
    <title>新报告阅读</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
          name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <link rel="stylesheet" href="/dist/css/oa-app.css">
    <link rel="stylesheet" href="/dist/css/oa-app.css">
    <script src="https://file.ggxqce.com/web/vue.min.js"></script>
</head>
<style>
    body, html {
        width: 100%;
        margin: 0;
        font-family: "微软雅黑";
    }

    #allmap, #allmap2 {
        /*width: 100%;*/
        height: 300px;
        overflow: hidden;
        margin: 0;
        font-family: "微软雅黑";
    }

    [v-cloak] {
        display: none;
    }

    * {
        -webkit-box-sizing: border-box;
        -moz-box-sizing: border-box;
        box-sizing: border-box;
        font-size: 12px;
    }

    body {
        margin: 1px;
        background: #ffffff;
    }

    .boxBoy {
        background: #fff;
    }

    table {
        border-spacing: 0;
        border-collapse: collapse;
        display: table;
    }

    .weather {
        text-align: center;
        font-size: 16px;
        /*position: absolute;*/
        top: 5px;
        line-height: 30px;
        float: left;
    }

    th {
        font-weight: normal;
    }

    table.text-center, table.text-center td, table.text-center th {
        text-align: center;
        font-size: 12px;
        margin-top: -1px;
    }

    .table-bordered > thead > tr > th, .table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > th, .table-bordered > thead > tr > td, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td {
        border: 1px solid #cbcbcd;
        height: 28px;
         color: #333;
        padding: 0 4px;
    }

    table th {
        background: #f8f8f8;
    }

    .table-bordered {
        border: 1px solid #cbcbcd;
    }

    .table {
        width: 100%;
        max-width: 100%;
    }

    .hidden {
        display: none;
    }

    .lineOne, .lineTwo {
        text-align: left;
    }

    .tdColor {
        background-color: #f8f8f8;
        font-weight: normal;
    }

    .lineOne span {
        max-height: 24px;
         overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 1;
        text-align: left;
    }

    .lineTwo span {
        max-height: 55px;
        line-height: 16px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        text-align: left;
        padding: 5px;

    }

    .div-td-content-more {
        position: absolute;
        height: auto;
        z-index: 999;
        line-height: 20px;
        background-color: #d3e8fd;
        padding: 8px 6px;
        border: 1px solid #e8e8ea;
        display: none;
    }

    .div-td-content-more i {
        width: 15px;
        height: 12px;
        background: url("/dist/img/more-icon.png");
        position: absolute;
        left: 50px;
        top: -12px;
    }

    .clear {
        clear: both
    }

    .boxItem {
        width: 100%;
        margin-top: 5px;
        background: inherit;
        /*background-color: rgba(255, 255, 255, 1);*/
        border: none;
        position: relative;
    }

    .boxItemTitle {
        color: #000;
        font-size: 22px;
        font-weight: bold;
        margin-bottom: 6px;
        text-align: center;
    }

    .home {
        font-size: 14px;
        font-weight: bold;
        margin-bottom: 10px;
        height: 14px;
        line-height: 14px;
        text-align: center;
    }

    .dian-icon {
        background: url("/dist/img/dian.png") no-repeat;
        background-size: cover;
        width: 14px;
        height: 14px;
        display: inline-block;
    }

    .jiaobiao, .jiaobiaoNew {
        position: relative;
    }

    .jiaobiao i {
        display: block;
        width: 0;
        height: 0;
        border-width: 0px 0 12px 12px;
        border-style: solid;
        border-color: transparent transparent transparent #2a8cec;
        position: absolute;
        top: 0px;
        left: 0px;
    }

    .jiaobiaoNew i {
        display: block;
        width: 12px;
        height: 12px;
        background: url("/dist/img/newLog2.png");
        background-size: 100% 100%;
        position: absolute;
        top: 0px;
        left: 0px;
    }

    .lineImg {
        padding-top: 5px !important;
        padding-bottom: 5px !important;
    }

    .lineImg img {
        height: 45px;
        width: 45px;
        float: left;
        margin: 10px;
        object-fit: cover;
    }

    .newCustomer {
        background: url(/dist/img/new.png) no-repeat;
        background-size: cover;
        width: 20px;
        height: 20px;
        right: 0;
        top: 2px;
        position: absolute;
    }

    .wajueji {
        padding-left: 140px;
        background: url("/dist/img/wajueji.png") no-repeat;
        background-size: 120px 88px;
        height: 88px;
        line-height: 88px;
        color: red;
        font-size: 14px;
        font-weight: bold;
        margin-left: 50px;
    }

    .qipao {
        /*background: url(/dist/img/qipao.png);*/
        background-size: 100% 100%;
        height: 88px;
        /* padding: 0 20px; */
        padding-left: 20px;
        /*padding-right: 20px;*/
        color: red;
        line-height: 88px;
        float: left;
        font-size: 14px;
        font-weight: bold;
    }

    .plan1 {
        background: url("/dist/img/plan1.png") no-repeat center center;
        background-size: 100%;
    }

    .plan2 {
        background: url("/dist/img/plan2.png") no-repeat center center;
        background-size: 100%;
    }

    .plan3 {
        background: url("/dist/img/plan3.png") no-repeat center center;
        background-size: 100%;
    }

    .boxItemTitleNotice {
        color: red;
        font-size: 22px;
        font-weight: bold;
        margin-bottom: 10px;
        text-align: center;
    }

    .boxItemTitleNotice i {
        background: url("/dist/img/jg.png") no-repeat center center;
        height: 22px;
        width: 22px;
        background-size: cover;
        display: inline-block;
        margin-bottom: -3px;
        margin-left: 5px;
    }

    .boxItemTitleNoticeTime {
        color: red;
        font-size: 20px;
        font-weight: bold;
        margin-bottom: 10px;
        text-align: center;
    }

    .boxItemTitleNoticeTime i {
        background: url("/dist/img/jg.png") no-repeat center center;
        height: 16px;
        width: 16px;
        background-size: cover;
        display: inline-block;
        margin-bottom: -3px;
        margin-left: 5px;
    }

    .search-button {
        width: 14px;
        height: 14px;
        background-image: url(/dist/img/glass.jpg);
        border: 0 none;
        cursor: pointer;
        margin-top: 0px;
    }

    input[type=button] {
        outline: none;
    }

    .oaBtn {
        background: url(/dist/img/btn-bj2.png) repeat-y !important;
        background-size: 100% 100% !important;
        color: #fff !important;
    }

    .btn-group-sm > .btn, .btn-sm {
        padding: 2px 10px;
    }

    .btn {
        border-radius: 3px;
        -webkit-box-shadow: none;
        box-shadow: none;
        border: 1px solid transparent;
    }

    .pull-right {
        float: right !important;
    }

    .blue {
        color: #39c;
    }

    .red {
        color: #e03800;
    }

    .weather img {
        height: 30px;
        width: 30px;
        float: left;
    }

    .templateStyle {
        margin-top: 10px;
        margin-left: 10px;
        margin-right: 10px;
    }

    .line {
        border-bottom: 4px solid #2a8cec;
    }

</style>
<body>
<section class="content" id="app" v-cloak>
    <div class="div-td-content-more"><i></i></div>
    <!--未读/未提交-->
    <div class="templateStyle">
        <!--v-if="wei2&&wei2.weiDu.total>0&&wei2.weiFaSong.total>0"-->
        <table class="table table-bordered text-center table-width" v-if="wei2[0].total>0||wei2[1].total>0">
            <tbody>
            <tr>
                <td colspan="3" class="tableTitle">
                    未读/未提交
                </td>
            </tr>
            </tbody>
        </table>
        <table class="table table-bordered text-center table-width" v-if="wei2[0].total>0||wei2[1].total>0">
            <tbody>
           <!-- <tr>
                <td class="tdColor" style="width: 20%;">状态</td>
                <td class="tdColor" style="width: 20%;">人数</td>
                <td class="tdColor" >名单</td>
            </tr>-->
            <tr v-for="(item,i) in wei2" v-if="item.total>0">
                <!--class="lineOne"-->

                <td v-if="i==0" style="width: 20%;">未读</td>
                <td v-if="i==1"  style="width: 20%;" >未提交</td>
                <!--<td>{{item.total}}</td>-->
                <td style="text-align: left">{{item.list}}</td>

            </tr>
            </tbody>
        </table>
    </div>

    <!--区域支持-->
    <div class="templateStyle" v-if="quYuZhiChiList&&quYuZhiChiList.length>0">
        <table class="table table-bordered text-center table-width"
        >
            <tbody>
            <tr>
                <td colspan="5" class="tableTitle">
                    区域支持
                </td>
            </tr>
            </tbody>
        </table>
        <table class="table table-bordered text-center table-width">
            <tbody>
            <tr v-if="quYuZhiChiList&&quYuZhiChiList.length>0">
                <td class="tdColor" style="width: 20%;">阅读人</td>
                <td class="tdColor" style="width: 20%;">大区</td>
                <td class="tdColor" style="width: 20%;">姓名</td>
                <td class="tdColor" style="width: 20%;">阅读状态</td>
                <td class="tdColor" style="width: 20%;">评价数量</td>
            </tr>
            <tr v-for="(item,i) in quYuZhiChiList">
                <td :rowspan="item.readerNamespan"
                    :class="{hidden: item.readerNamedis}">
                 <span class="oa-name">   {{item.readerName}}</span>
                </td>
                <td class="lineOne">
                    <span style="text-align: center">{{item.regionName.replace(/大区/g,'')}}</span>
                </td>
                <td>
                            <span v-if="item.leaveDate == '出勤'&&item.titleSend == '已发送'"
                                  style="color: #2a8cec;cursor: pointer;"
                                  @click="openWork(item)" class="oa-name">
                                            {{item.userName}}
                                        </span>
                    </span>
                    <span v-else class="oa-name">{{item.userName}}
                            </span>
                </td>
                <td>
                    <template v-if="item.leaveDate != '请假'">
                        <template v-if="item.leaveDate == '出勤'">
                            <template v-if="item.titleSend != '未发送'">
                                <template v-if="item.reader=='已读'">
                                    √
                                </template>
                                <template v-else-if="item.reader=='未读'">
                                    ×
                                </template>
                            </template>
                            <template v-else>
                                未提交
                            </template>
                        </template>

                        <template v-else>
                            <span v-if="item.userName==''"></span>
                            <span v-else style="color: #333333;">缺勤</span>
                        </template>
                    </template>

                    <template v-else>
                        请假
                    </template>
                </td>
                <!--<td class="lineOne"><span style="text-align: center">{{item.reader}}</span>-->
                <!--</td>-->
                <td>
                    <span v-if="item.userName==''"></span>
                    <span v-else-if="item.evaluationNum!=0" @click="getEvaluationNum(item.userId)"
                          style="color: #2a8cec;cursor: pointer;">{{item.evaluationNum}}</span>
                    <span v-else>{{item.evaluationNum}}</span>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
    <!--销售总监-->
    <div class="templateStyle" v-if="xiaoShouZongJianList&&xiaoShouZongJianList.length>0">
        <table class="table table-bordered text-center table-width">
            <tbody>
            <tr>
                <td colspan="5" class="tableTitle">
                    销售总监
                </td>
            </tr>
            </tbody>
        </table>
        <table class="table table-bordered text-center table-width">
            <tbody>
            <tr v-if="xiaoShouZongJianList&&xiaoShouZongJianList.length>0">
                <td class="tdColor" style="width: 20%;">阅读人</td>
                <td class="tdColor" style="width: 20%;">公司</td>
                <td class="tdColor" style="width: 20%;">姓名</td>
                <td class="tdColor" style="width: 20%;">阅读状态</td>
                <td class="tdColor" style="width: 20%;">评价数量</td>
            </tr>
            <tr v-for="(item,i) in xiaoShouZongJianList">
                <td :rowspan="item.readerNamespan"
                    :class="{hidden: item.readerNamedis}">
             <span  class="oa-name">    {{item.readerName}}</span>
                </td>
                <td class="lineOne">
                    <span style="text-align: center">{{item.regionName}}</span>
                </td>
                <td>
                    <template v-if="item.leaveDate == '出勤'">
                        <template v-if="item.titleSend != '未发送'">
                            <template v-if="item.reader=='已读' || item.reader=='未读'">
                                        <span style="color: #2a8cec;cursor: pointer;"
                                              @click="openWork(item)" class="oa-name">
                                            {{item.userName}}
                                        </span>
                            </template>
                        </template>
                        <template v-else ><span class="oa-name">{{item.userName}}</span>
                        </template>
                    </template>
                    <template v-else ><span class="oa-name">{{item.userName}}</span></template>
                </td>
                <td>
                    <template v-if="item.leaveDate != '请假'">
                        <template v-if="item.leaveDate == '出勤'">
                            <template v-if="item.titleSend != '未发送'">
                                <template v-if="item.reader=='已读'">
                                    √
                                </template>
                                <template v-else-if="item.reader=='未读'">
                                    ×
                                </template>
                            </template>
                            <template v-else>
                                未提交
                            </template>
                        </template>

                        <template v-else>
                            <span v-if="item.userName==''"></span>
                            <span v-else style="color: #333333;">缺勤</span>
                        </template>
                    </template>

                    <template v-else>
                        请假
                    </template>
                </td>
                <!--<td class="lineOne"><span style="text-align: center">{{item.reader}}</span>-->
                <!--</td>-->
                <td>
                    <span v-if="item.userName==''"></span>
                    <span v-else-if="item.evaluationNum!=0" @click="getEvaluationNum(item.userId)"
                          style="color: #2a8cec;cursor: pointer;">{{item.evaluationNum}}</span>
                    <span v-else>{{item.evaluationNum}}</span>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
    <!--区域总监-->
    <div class="templateStyle" v-if="quYuZongJianList&&quYuZongJianList.length>0">
        <table class="table table-bordered text-center table-width"
        >
            <tbody>
            <tr>
                <td colspan="5"  class="tableTitle">
                    区域总监
                </td>
            </tr>
            </tbody>
        </table>
        <table class="table table-bordered text-center table-width">
            <tbody>
            <tr v-if="quYuZongJianList&&quYuZongJianList.length>0">
                <td class="tdColor" style="width: 20%;">阅读人</td>
                <td class="tdColor" style="width: 20%;">大区</td>
                <td class="tdColor" style="width: 20%;">姓名</td>
                <td class="tdColor" style="width: 20%;">阅读状态</td>
                <td class="tdColor" style="width: 20%;">评价数量</td>
            </tr>
            <tr v-for="(item,i) in quYuZongJianList">
                <td :rowspan="item.readerNamespan"
                    :class="{hidden: item.readerNamedis}">
                <span class="oa-name">   {{item.readerName}}</span>
                </td>
                <td class="lineOne">
                    <span style="text-align: center">{{item.regionName.replace(/大区/g,'')}}</span>
                </td>
                <td>
                            <span v-if="item.leaveDate == '出勤'&&item.titleSend == '已发送'"
                                  style="color: #2a8cec;cursor: pointer;"
                                  @click="openWork(item)" class="oa-name">
                                            {{item.userName}}
                                        </span>
                    </span>
                    <span v-else class="oa-name">{{item.userName}}
                            </span>
                </td>
                <td>
                    <template v-if="item.leaveDate != '请假'">
                        <template v-if="item.leaveDate == '出勤'">
                            <template v-if="item.titleSend != '未发送'">
                                <template v-if="item.reader=='已读'">
                                    √
                                </template>
                                <template v-else-if="item.reader=='未读'">
                                    ×
                                </template>
                            </template>
                            <template v-else>
                                未提交
                            </template>
                        </template>

                        <template v-else>
                            <span v-if="item.userName==''"></span>
                            <span v-else style="color: #333333;">缺勤</span>
                        </template>
                    </template>

                    <template v-else>
                        请假
                    </template>
                </td>

                <!--<td class="lineOne"><span style="text-align: center">{{item.reader}}</span>-->
                <!--</td>-->
                <td>
                    <span v-if="item.userName==''"></span>
                    <span v-else-if="item.evaluationNum!=0" @click="getEvaluationNum(item.userId)"
                          style="color: #2a8cec;cursor: pointer;">{{item.evaluationNum}}</span>
                    <span v-else>{{item.evaluationNum}}</span>
                </td>
            </tr>
            </tbody>
        </table>
    </div>

    <!--大区经理-->
    <div class="templateStyle" v-if="daQuList&&daQuList.length>0">
        <table class="table table-bordered text-center table-width"
               v-if="daQuList&&daQuList.length>0">
            <tbody>
            <tr>
                <td colspan="5"  class="tableTitle">
                    大区经理
                </td>
            </tr>
            </tbody>
        </table>
        <table class="table table-bordered text-center table-width">
            <tbody>
            <tr v-if="daQuList&&daQuList.length>0">
                <td class="tdColor" style="width: 20%;">阅读人</td>
                <td class="tdColor" style="width: 20%;">大区</td>
                <td class="tdColor" style="width: 20%;">姓名</td>
                <td class="tdColor" style="width: 20%;">阅读状态</td>
                <td class="tdColor" style="width: 20%;">评价数量</td>
            </tr>
            <tr v-for="(item,i) in daQuList">
                <td :rowspan="item.readerNamespan"
                    :class="{hidden: item.readerNamedis}">
               <span  class="oa-name">{{item.readerName}}</span>
                </td>
                <td class="lineOne">
                    <span style="text-align: center">{{item.regionName.replace(/大区/g,'')}}</span>
                </td>
                <td>
                            <span v-if="item.leaveDate == '出勤'&&item.titleSend == '已发送'"
                                  style="color: #2a8cec;cursor: pointer;"
                                  @click="openWork(item)" class="oa-name">
                                            {{item.userName}}
                                        </span>
                    </span>
                    <span v-else class="oa-name">{{item.userName}}
                            </span>
                </td>
                <td>
                    <template v-if="item.leaveDate != '请假'">
                        <template v-if="item.leaveDate == '出勤'">
                            <template v-if="item.titleSend != '未发送'">
                                <template v-if="item.reader=='已读'">
                                    √
                                </template>
                                <template v-else-if="item.reader=='未读'">
                                    ×
                                </template>
                            </template>
                            <template v-else>
                                未提交
                            </template>
                        </template>

                        <template v-else>
                            <span v-if="item.userName==''"></span>
                            <span v-else style="color: #333333;">缺勤</span>
                        </template>
                    </template>

                    <template v-else>
                        请假
                    </template>
                </td>

                <!--<td class="lineOne"><span style="text-align: center">{{item.reader}}</span>-->
                <!--</td>-->
                <td>
                    <span v-if="item.userName==''"></span>
                    <span v-else-if="item.evaluationNum!=0" @click="getEvaluationNum(item.userId)"
                          style="color: #2a8cec;cursor: pointer;">{{item.evaluationNum}}</span>
                    <span v-else>{{item.evaluationNum}}</span>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
    <!-- &lt;!&ndash;区域组长&ndash;&gt;
     <div class="templateStyle" v-if="quYuZuZhangList&&quYuZuZhangList.length>0">
         <table class="table table-bordered text-center table-width"
                v-if="quYuZuZhangList&&quYuZuZhangList.length>0">
             <tbody>
             <tr>
                 <td colspan="5" style="background: #2a8cec;color: #fff;">
                     区域组长
                 </td>
             </tr>
             </tbody>
         </table>
         <table class="table table-bordered text-center table-width">
             <tbody>
             <tr v-if="quYuZuZhangList&&quYuZuZhangList.length>0">
                 <td class="tdColor" style="width: 20%;">阅读人</td>
                 <td class="tdColor" style="width: 20%;">区域</td>
                 <td class="tdColor" style="width: 20%;">姓名</td>
                 <td class="tdColor" style="width: 20%;">阅读状态</td>
                 <td class="tdColor" style="width: 20%;">评价数量</td>
             </tr>
             <tr v-for="(item,i) in quYuZuZhangList">
                 <td :rowspan="item.readerNamespan"
                     :class="{hidden: item.readerNamedis}">
                     {{item.readerName}}
                 </td>
                 <td class="lineOne">
                     <span style="text-align: center">{{item.regionName.replace(/大区/g,'')}}</span>
                 </td>
                 <td>
                     <template v-if="item.leaveDate == '未请假'">
                         <template v-if="item.titleSend != '未发送'">
                             <template v-if="item.reader=='已读' || item.reader=='未读'">
                                         <span style="color: #2a8cec;cursor: pointer;"
                                               @click="openWork(item)">
                                             {{item.userName}}
                                         </span>
                             </template>
                         </template>
                         <template v-else><span
                                 style="color: #2a8cec;">{{item.userName}}</span>
                         </template>
                     </template>
                     <template v-else>{{item.userName}}</template>
                 </td>
                 <td>
                     <template v-if="item.leaveDate == '未请假'">
                         <template v-if="item.titleSend != '未发送'">
                             <template v-if="item.reader=='已读'">
                                 √
                             </template>
                             <template v-else-if="item.reader=='未读'">
                                 ×
                             </template>
                         </template>
                         <template v-else>
                             <span v-if="item.userName==''"></span>
                             <span v-else style="color: #333333;">缺勤</span>
                         </template>
                     </template>

                     <template v-else>
                         {{item.leaveDate}}
                     </template>
                 </td>
                 &lt;!&ndash;<td class="lineOne"><span style="text-align: center">{{item.reader}}</span>&ndash;&gt;
                 &lt;!&ndash;</td>&ndash;&gt;
                 <td>
                     <span v-if="item.userName==''"></span>
                     <span v-else>{{item.replyNum}}</span>
                 </td>
             </tr>
             </tbody>
         </table>
     </div>-->
    <!--各大区区域经理的数据-->
    <div class="templateStyle" v-for="allPlanItem in allPlanList"
         v-if="allPlanItem.planList&&allPlanItem.planList.length>0">
        <div class="boxItem">
            <div class="boxBoy">
                <table class="table table-bordered text-center table-width">
                    <tbody>
                    <tr>
                        <td colspan="4"  class="tableTitle">
                            {{allPlanItem.title}}
                        </td>
                    </tr>
                    </tbody>
                </table>
                <table class="table table-bordered text-center table-width">
                    <tbody>
                    <tr>
                        <td class="tdColor" style="width: 20%;">阅读人</td>
                        <td class="tdColor" style="width: 20%;">区域</td>
                        <td class="tdColor" style="width: 20%;">姓名</td>
                        <td class="tdColor" style="width: 20%;">阅读状态</td>
                        <td class="tdColor" style="width: 20%;">评价数量</td>
                    </tr>
                    <tr v-for="item in tablesMergeCell(allPlanItem.planList)">
                        <td :rowspan="item.readerNamespan"
                            :class="{hidden: item.readerNamedis}">
                         <span class="oa-name">   {{item.readerName}}</span>
                        </td>
                        <td class="lineOne">
                            <span style="text-align: left">{{item.regionName.replace(/大区/g,'')}}</span>
                        </td>
                        <td>
                            <span v-if="item.leaveDate == '出勤'&&item.titleSend == '已发送'"
                                  style="color: #2a8cec;cursor: pointer;"
                                  @click="openWork(item)" class="oa-name">
                                            {{item.userName}}
                                        </span>
                            </span>
                            <span v-else class="oa-name">{{item.userName}}
                            </span>
                        </td>
                        <td>
                            <template v-if="item.leaveDate != '请假'">
                                <template v-if="item.leaveDate == '出勤'">
                                    <template v-if="item.titleSend != '未发送'">
                                        <template v-if="item.reader=='已读'">
                                            √
                                        </template>
                                        <template v-else-if="item.reader=='未读'">
                                            ×
                                        </template>
                                    </template>
                                    <template v-else>
                                        未提交
                                    </template>
                                </template>

                                <template v-else>
                                    <span v-if="item.userName==''"></span>
                                    <span v-else style="color: #333333;">缺勤</span>
                                </template>
                            </template>

                            <template v-else>
                                请假
                            </template>
                        </td>
                        <!--<td class="lineOne"><span style="text-align: center">{{item.reader}}</span>-->
                        <!--</td>-->
                        <td>
                            <span v-if="item.userName==''"></span>
                            <span v-else-if="item.evaluationNum!=0" @click="getEvaluationNum(item.userId)"
                                  style="color: #2a8cec;cursor: pointer;">{{item.evaluationNum}}</span>
                            <span v-else>{{item.evaluationNum}}</span>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <div class="clear"></div>
        <div class="clear"></div>
    </div>
    <div style="margin-bottom: 15px;"></div>

</section>
<!--JQ-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="/dist/plugins/scroll/myScroll.js"></script>
<!--框架已定义 JS-->
<!--oa自定义  JS-->
<script src="/dist/js/oaApp.js"></script>

<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script>
    $(function () {
        $("body").on("click", ".lineOne,.lineTwo", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {
                var text = $(this).text();
                if (text != "") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + "px",
                        "left": $(this).offset().left,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
</script>
<script>
    $.ajaxSetup({
        global: true,
        type: "POST",
        cache: false,
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        beforeSend: function () {
        },
        complete: function () {

        },
        error: function (e) {
            alert('error' + e.responseText);
        }
    });
    $.extend($.wyui, {
        postMethod: function (url, data, callback, sync, id) {
            if (!id) {
                id = "#app"
            }
            $.ajax({
                url: server.ip + url,
                async: sync ? false : true,
                data: JSON.stringify(data),
                beforeSend: function () {

                },
                complete: function () {
                    setTimeout(function () {
                    }, 1000);

                },
                success: function (r) {
                    if (!r.e.code) {
                        callback(r.data.sendData);
                    } else {
                        alert(r.e.desc);
                    }
                },
                error: function (e) {
                    alert(url + e.responseText);
                }
            });
        },
    });
</script>
<script type="text/javascript">
    var app = new Vue({
        el: "#app",
        data: {
            userId: getUrlParamObj().userId,
            dateTime: getUrlParamObj().dateTime,
            roleName: getUrlParamObj().roleName,
            regionId: getUrlParamObj().departId ? getUrlParamObj().departId : '',
            allPlanList: [],
            planList: [],
            daQuList: [],
            quYuZuZhangList: [],
            xiaoShouZongJianList: [],
            quYuZhiChiList: [],
            quYuZongJianList: [],
            quYuList: [],
            wei2: [
                {
                    total: 0,
                    list: '',
                },
                {
                    total: 0,
                    list: '',
                },
            ],
        },
        methods: {
            //合并单元格
            tablesMergeCell: function (list) {
                if (list != undefined && list && list.length > 0) {
                    for (field in list[0]) {
                        var k = 0;
                        while (k < list.length) {
                            list[k][field + 'span'] = 1;
                            list[k][field + 'dis'] = false;
                            for (var i = k + 1; i <= list.length - 1; i++) {
                                if (list[k][field] == list[i][field] && list[k][field] != '') {
                                    list[k][field + 'span']++;
                                    list[k][field + 'dis'] = false;
                                    list[i][field + 'span'] = 1;
                                    list[i][field + 'dis'] = true;
                                } else {
                                    break;
                                }
                            }
                            k = i;
                        }
                    }
                }
                return list;
            },
            openWork: function (item) {
                if (item.readerId == getUrlParamObj().userId) {
                    item.reader = "已读";
                }
                var obj = {
                    type: 'goWorkReportDetail',
                    url: '',
                    emailId: item.emailId,
                    wId: item.WId,
                    name: "工作报告详情",
                }
                prompt(JSON.stringify(obj))
            },
            //获取大区
            get_daQu: function () {
                var that = this;

                $.wyui.postMethod(urlConfig.newZXQReportForm.getBRMEmailForZSQ, {
                    "userId": that.userId,
                    "dateTime": that.dateTime,
                }, function (data) {
                    //由于兼职原因, 大区排序,需要合并阅读人
                    that.daQuList = that.tablesMergeCell(handlerData(data.records));
                    that.wei2function(data.records);
                });
            },
            //获取区域总监
            get_quYuZongJian: function (type, roleName) {
                var that = this;

                if (type == 1) {

                    $.wyui.postMethod(urlConfig.newZXQReportForm.getRDEmailForZSQ, {
                        "userId": that.userId,
                        "dateTime": that.dateTime,
                    }, function (data) {
                        // that.quYuZongJianList = that.tablesMergeCell(data.records);

                        that.quYuZongJianList = collapseArea(data.records);
                        that.wei2function(data.records);

                    });
                } else if (type == 0) {
                    $.wyui.postMethod(urlConfig.newZXQReportForm.getRDEmailForRS, {
                        "userId": that.userId,
                        "dateTime": that.dateTime,
                        "roleName": '区域支持',
                    }, function (data) {

                        var list = data.records;
                        if (roleName && '区域支持' == roleName) {
                            var listCopy = [];
                            for (var i = 0; i < list.length; i++) {
                                if (list[i].readerId == that.userId) {
                                    listCopy.push(list[i]);
                                }
                            }
                            list = listCopy;
                        }

                        that.quYuZongJianList = that.tablesMergeCell(list);

                        //that.quYuZongJianList = collapseArea(data.records)
                    });
                } else {

                    $.wyui.postMethod(urlConfig.newZXQReportForm.getRDEmailForRS, {
                        "userId": that.userId,
                        "dateTime": that.dateTime,
                        "roleName": '销售管理',
                    }, function (data) {
                        // that.quYuZongJianList = that.tablesMergeCell(data.records);

                        that.quYuZongJianList = collapseArea(data.records)
                    });
                }

            },
            getEvaluationNum: function (userId) {
                var that = this;
                var obj = {
                    type: 'goDetail',
                    url: '/reportForm/newReportForm/evaluationListApp.html?userId=' + userId,
                    name: '评价详情',
                }
                prompt(JSON.stringify(obj))
            },
            //获取销售总监
            get_xiaoShouZongJian: function (type) {
                var that = this;
                if (type == 1) {

                    $.wyui.postMethod(urlConfig.newZXQReportForm.getSDEmailForZSQ, {
                        "userId": that.userId,
                        "dateTime": that.dateTime,
                    }, function (data) {

                        that.xiaoShouZongJianList = collapseArea(data.records);
                        that.wei2function(data.records);
                    });
                } else {

                    $.wyui.postMethod(urlConfig.newZXQReportForm.getSDEmailForXM, {
                        "userId": that.userId,
                        "dateTime": that.dateTime,
                    }, function (data) {

                        that.xiaoShouZongJianList = collapseArea(data.records);
                        that.wei2function(data.records);
                    });

                }
            },
            //获取区域组长
            get_quYuZuZhang: function () {
                var that = this;

                $.wyui.postMethod(urlConfig.newZXQReportForm.getEmailByUserIdForRTL, {
                    "userId": that.userId,
                    "dateTime": that.dateTime,
                }, function (data) {
                    that.quYuZuZhangList = that.tablesMergeCell(data.records);


                });
            },
            //获取区域支持
            get_quYuZhiChi: function () {
                var that = this;

                $.wyui.postMethod(urlConfig.newZXQReportForm.getRSEmailForXM, {
                    "userId": that.userId,
                    "dateTime": that.dateTime,
                }, function (data) {
                    that.quYuZhiChiList = collapseArea(data.records);


                });
            },
            //获取区域
            get_quYu: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.newZXQReportForm.getRegionIdByUserIdForZSQ, {
                    "userId": that.userId
                }, function (data) {
                    var quYuList = data.records;
                    for (var i = 0; i < quYuList.length; i++) {
                        var regionId = quYuList[i].regionId;
                        var brmName = quYuList[i].brmName && quYuList[i].brmName != '' ? '-' + quYuList[i].brmName : ''
                        var obj = {
                            title: quYuList[i].regionName + brmName,
                            planList: []
                        }
                        that.allPlanList.push(obj);
                        that.get_rm(regionId, quYuList[i].regionName, i);

                    }
                    var obj = {
                        dialog: 'hidden'
                    }
                    prompt(JSON.stringify(obj))
                });
            },
            //获取区域经理
            get_rm: function (regionId, regionName, index) {
                var that = this;
                $.wyui.postMethod(urlConfig.newZXQReportForm.getEmailByUserIdForRM, {
                    "userId": that.userId,
                    "dateTime": that.dateTime,
                    "regionId": regionId,
                }, function (data) {
                    var list = data.records;
                    var newList = [];
                    var array = [];
                    for (var i = 0; i < list.length; i++) {
                        var userId = list[i].userId;
                        if (userId) {
                            if (array.indexOf(userId) > -1) {
                            } else {
                                array.push(userId);
                                newList.push(list[i]);
                            }
                        } else {
                            newList.push(list[i]);
                        }

                    }
                    that.allPlanList[index].planList = newList;
                    that.wei2function(newList);
                });
            },
            //获取权限
            get_roleName: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.newZXQReportForm.getRoleNameByUserId, {
                    "userId": that.userId,
                }, function (data) {
                    var roleName = data.records;
                    if ('区域支持' == roleName || '销售管理' == roleName) {
                        switch (roleName) {
                            case '销售管理':
                                that.get_xiaoShouZongJian(0);
                                that.get_quYuZhiChi();
                            //that.get_quYuZongJian(2);

                            case '区域支持':
                                that.get_quYuZongJian(0, roleName);

                            default:
                                roleName = '区域总监';
                        }
                    }
                    switch (roleName) {
                        case '总经理':
                            that.get_xiaoShouZongJian(1);
                        case '销售总监':
                            that.get_quYuZongJian(1);
                        case '区域总监':
                            that.get_daQu();
                        default :
//                            that.get_quYuZuZhang();
                            that.get_quYu();
                    }
                });

            },
            wei2function: function (list) {
                var that = this;
                /* wei2     ->total/list
                                 ->total/list */
                //  reader    已读/未读      ---> readerName
                //  titleSend  已发送/未发送    --->  userName
                if (list) {
                    for (var i = 0; i < list.length; i++) {
                        var wrp = list[i];

                        if (wrp.reader == '未读') {
                            if (wrp.readerName && wrp.readerName != '' && wrp.userName && wrp.userName != ''&&wrp.titleSend != '未发送') {
                                if (that.wei2[0].list.indexOf(wrp.readerName) < 0) {
                                    that.wei2[0].list += wrp.readerName + ';';
                                    that.wei2[0].total++;
                                }
                            }
                        }
                        if (wrp.titleSend == '未发送') {
                            if (wrp.userName && wrp.userName != ''&&wrp.leaveDate!='请假') {
                                if (that.wei2[1].list.indexOf(wrp.userName) < 0) {
                                    that.wei2[1].list += wrp.userName + ';';
                                    that.wei2[1].total++;
                                }
                            }
                        }
                    }
                }
            }
        },
        mounted: function () {
            var that = this;
            var obj = {
                dialog: 'show'
            }
            prompt(JSON.stringify(obj))
            that.get_roleName();
            //that.get_quYuZongJian(0);
        }
    })
</script>
<script>

    function handlerData(list) {
        var readerNameStr = ''
        var noRepeatList = []
        for (var i = 0; i < list.length; i++) {
            if (readerNameStr.indexOf(list[i].readerName) < 0) {
                readerNameStr += list[i].readerName
                list[i].regionSortNo = i
                noRepeatList.push(list[i])
            }
        }
//        for (var i = 0; i < list.length; i++) {
//            for (var j = 0; j < noRepeatList.length; j++) {
//                if (list[i].readerName == noRepeatList[j].readerName) {
//                    list[i].regionSortNo = noRepeatList[j].regionSortNo
//                }
//            }
//        }
//        for (var i = 0; i < list.length; i++) {
//            console.log(list[i].regionName + '  ' + list[i].regionSortNo)
//        }
        return list
    }

    function regionSortNoAsc(property) {
        return function (a, b) {
            var value1 = a[property];
            var value2 = b[property];
            return value1 - value2;
        }
    }

    function collapseArea(list) {
        var noRepeatList = []
        var userIdStr = ''
        if (list) {
            for (var i = 0; i < list.length; i++) {
                if (userIdStr.indexOf(list[i].userId) < 0 || !list[i].userId) {
                    noRepeatList.push(list[i])
                    if (list[i].userId) {
                        userIdStr += list[i].userId
                    }
                }
            }
            for (var i = 0; i < noRepeatList.length; i++) {
                for (var j = 0; j < list.length; j++) {
                    if (list[j].userId && noRepeatList[i].userId == list[j].userId && noRepeatList[i].regionName.indexOf(list[j].regionName) < 0) {
                        noRepeatList[i].regionName = noRepeatList[i].regionName + "/" + list[j].regionName
                    }
                }
            }

            return app.tablesMergeCell(noRepeatList);
        }
    }
</script>
</body>
</html>